#! /bin/bash

set -x

android_top=$(get_android_top.sh)
if [ $android_top = '/' ]
then
    echo "can't find android top dir"
    exit 0
fi
                                                                                                                                                                         
cd $android_top  

if ! [ -f manifests.all ]
then
    echo "building manifest list ...."
    find . -type f -iname "androidmanifest.xml" > manifests.all
fi
set -

if [ $# = 1 ]
then

    for this_file in `cat manifests.all`
    do 
        cat $this_file | grep --color=auto -i $1 && echo "matched in $android_top/$this_file" && echo ""
    done

fi

